<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>夜读书网，书籍的海洋与阅读者的大陆</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="author" content="夜读书">
    <meta name="description" content="夜读书是一个社交阅读网站，它允许用户跟好友分享他们的阅读消息：包括他们读过哪几本书，正在读哪些书，想读哪些书等等。">
    <meta name="keywords" content="读书,阅读,小说,文学">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="{{ asset('/bootstrap-3.3.5-dist/css/bootstrap.min.css') }}">
    <link rel="stylesheet" href="{{ asset('/style/css/yds.css') }}">
    <link rel="stylesheet" href="{{ asset('/style/css/ucenter.css') }}">
    <script src="{{ asset('/scripts/jquery/jquery-1.11.3.min.js') }}"></script>
    <script src="{{ asset('/bootstrap-3.3.5-dist/js/bootstrap.min.js') }}"></script>
</head>
<body class="docs">
@include('books.partials.navtop')
@include('books.partials.nav')
<div class="docs-wrapper container">
    <article>
        <div class="section">

            <div class="ibklist">
                <h2>
                    <span class="">新书速递</span>
                    <span class="link-more"><a href="books">更多>></a></span>
                </h2>
                <ul class="list-col">
                @foreach ($books as $book)
                    <li class="">
                        <div class="cover">
                            <a href="{{ URL::action('BookController@show',['id'=>$book->book_id])}}" target="_blank" title="{{ $book->book_name }}">
                            <img src="{{ asset($book->bimg) }}" class="" alt="{{ $book->book_name }}" height="158px" width="106px">
                            </a>
                        </div>
                        <div class="">
                            <div class="title"><a class="" href="{{ URL::action('BookController@show',['id'=>$book->book_id])}}" target="_blank" title="{{ $book->book_name }}">
                            @if( mb_strlen($book->book_name)>7 )
                            {{ mb_substr($book->book_name, 0,7) }}...
                            @else
                            {{ $book->book_name }}
                            @endif
                            </a></div>
                            <div class="author">
                            @if( mb_strlen($book->zuozhe)>7 )
                            {{ mb_substr($book->zuozhe, 0,7) }}...
                            @else
                            {{ $book->zuozhe }}
                            @endif
                            </div>
                        </div>
                    </li>
                @endforeach
                </ul>
            </div>

            <div class="tongcheng">
                <h2 class="">
                    <span class="">阅邻</span>
                    <span class="link-more"><a href="{{url('shop?otype=S')}}" target="_blank">出售</a> <a href="{{url('shop?otype=J')}}" target="_blank">借阅</a> <a href="{{url('shop?otype=E')}}" target="_blank">交换</a> <a href="{{url('shop?otype=Z')}}" target="_blank">赠送</a><a href="{{url('shop')}}" class="shopmore">进入阅邻>></a></span>
                </h2>
                @if(count($bags)!=0)
                <ul class="list-col">
                    @foreach($bags as $bag)
                    <li class="">
                        <div class="cover">
                            <a href="{{url('shopinfo/'. $bag->id)}}" target="_blank" title="{{ $bag->books->book_name }}">
                            <img src="{{ asset($bag->books->bimg) }}" class="" alt="{{ $bag->books->book_name }}" height="158px" width="106px">
                            </a>
                        </div>
                        <div class="">
                            <div class="title"><a class="" href="{{url('shopinfo/'. $bag->id)}}" target="_blank" title="{{ $bag->books->book_name }}">
                            @if( mb_strlen($bag->books->book_name)>7 )
                            {{ mb_substr($bag->books->book_name, 0,7) }}...
                            @else
                            {{ $bag->books->book_name }}
                            @endif
                            </a></div>
                            <div class="price">
                                <span class="xianjia">￥{{ $bag->nowprice }}</span>
                                <span class="yuanjia">￥{{ $bag->books->dingjia }}</span>
                            </div>
                        </div>
                    </li>
                    @endforeach
                </ul>    
                @else
                    <div class="nodata">还没有可转让或出借的书籍。</div>
                @endif
            </div>

            <!-- <div class="reviewsindex">
                <h2 class="">
                    <span class="">书评</span>
                    <span class="link-more"><a class="" href="{{url('shupinglist')}}">进入书评专区>></a></span>
                </h2>
                @if(count($booksreviews)!=0)
                    @foreach($booksreviews as $booksreview)
                    <div class="liec">
                        <table class="ydstable">
                        <tbody>        
                            <tr>
                                <td class="avatar">
                                    <a href="{{url('info')}}/{{$booksreview->books->book_id}}" target="_blank">        
                                        <img src="{{url($booksreview->books->bimg)}}" title="{{$booksreview->books->book_name}}"></img>
                                    </a>
                                </td>
                                <td class="update">
                                    <div class="title"><a href="{{url('review')}}/{{$booksreview->id}}" title="{{$booksreview->title}}" target="_blank">{{$booksreview->title}}</a></div>
                                    <div class="name">
                                        <span>评论<a href="{{url('info')}}/{{$booksreview->books->book_id}}" target="_blank">《{{$booksreview->books->book_name}}》</a></span>
                                        <span class="rating allstar{{$booksreview->rating}}0"></span>
                                        <span class=""><a href="{{url('u')}}/{{$booksreview->uid}}">{{$booksreview->users->user_name}}</a></span>
                                        <span>{{date('Y-m-d H:i',$booksreview->add_time)}}</span>
                                    </div>
                                    <div class="zhaiyao">{{mb_substr(strip_tags($booksreview->bookreview),0,160)}}...... <a href="{{url('review')}}/{{$booksreview->id}}" target="_blank">(阅读全文...)</a></div>
                                </td>
                            </tr>        
                        </tbody>
                        </table>
                    </div>
                    @endforeach
                @else
                    <div class="nodata">还没有发表书评和读后感</div>
                @endif
            </div> -->

        </div>
    </article>

    <section class="sidebar">
        @include('books.partials.right')
        <div class="fenlei">
            <h2>书籍分类</h2>
            <ul class="unstyled">
            @foreach($fenleis as $fenlei)
                <li><a href="{{$fenlei->cat_id}}/catid" target="_blank"> {{$fenlei->cat_name}} </a></li>
            @endforeach
            </ul>
        </div>
        <div class="shudan">
            <h2>推荐主题书单</h2>
            <ul class="sdstyled">
            @foreach($shudans as $shudan)
                <li>
                <a href="{{asset('shudaninfo')}}/{{$shudan->id}}" title="{{$shudan->biaoti}}" target="_blank">
                 @if( mb_strlen($shudan->biaoti)>11 )
                    {{ mb_substr($shudan->biaoti, 0, 11) }}...
                @else
                    {{ $shudan->biaoti}}
                @endif
                 </a></li>
            @endforeach
            </ul>
        </div>
    </section>

</div>

@include('books.partials.footer')
</body>
</html>
